package com.arron.jvm;

import java.util.ArrayList;
import java.util.List;

/**
 * @Classname ClassLoaderTest
 * @Description TODO
 * @Date 2020/8/16 22:09
 * @Created by 刘
 */
public class ClassLoaderTest {

    public static void main(String[] args) {

        /**
         * rt.jar包下的类，java自带的类
         */
        List<String>  strs = new ArrayList<>();
        System.out.println(strs.getClass().getClassLoader());
        /**
         * 自定义的类
         */
        ClassLoaderTest classLoaderTest = new ClassLoaderTest();
        System.out.println(classLoaderTest.getClass().getClassLoader().getParent().getParent());
        System.out.println(classLoaderTest.getClass().getClassLoader().getParent());
        System.out.println(classLoaderTest.getClass().getClassLoader());
    }

}
